import Vue from 'vue'
import SvgIcon from '@/components/SvgIcon'// svg component

// register globally
Vue.component('svg-icon', SvgIcon)

// require.context('指定需要导入文件的路径', '是否递归获取', '正则匹配需要加载的文件类型')
const req = require.context('./svg', false, /\.svg$/)
// console.log(req, 'req')
// require.context导入svg的文件目录配置svg-sprite-loader插件webpack进行打包生成symbol
function requireAll(requireContext) {
  // console.log(requireContext.keys(), 'requireContext.keys()')
  // console.log(requireContext.keys().map(requireContext), 'requireContext.keys().map(requireContext)')
  return requireContext.keys().map(requireContext)
}
// const requireAll = requireContext => requireContext.keys().map(requireContext)
requireAll(req)
